package com.cloud.pages;

import org.openqa.selenium.By;

import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated;

public class PrivacyPage extends AnyPage {

    //Constructor
    public PrivacyPage(PageManager pages){
        super(pages);
    }


    //Variables
    private String privacyPageTitle = "Privacy Policy | Swivl";


    //Methods
    public PrivacyPage ensurePageLoaded() {
        wait.until(presenceOfElementLocated(By.xpath("//*/h2[text()='Privacy Policy']")));
        return this;
    }

    public boolean isLoaded() {
        try {
            wait.until(presenceOfElementLocated(By.xpath("//*/h2[text()='Privacy Policy']")));
            return true;
        } catch (Exception e) {
            return false;
        }
    }

    public String getPrivacyPageTitle() {
        return privacyPageTitle;
    }

}
